Page({
  data: {
    num: 2,
    btnState: {
      hideA: false,
      hideB: false
    }
  },
  requestData: function () {
    this._fetch({
      url: "getGoods",
    }).then(res => {
      if (res.length) {
        this._router.go("logs", { firstGoodsId: res[0].id })
      }
    })
  },
  changeNum: function (e) {
    let isAdd = e.currentTarget.dataset.type == 'a';
    this.setData({
      num: isAdd ? this.data.num += 1 : this.data.num -= 1
    })
  },
  changeBtn: function (e) {
    this.setData({
      btnState: e.detail
    })
  }
})
